#!/bin/sh
set -eu

for probe in main mainline production master; do
    if git local-branch-exists "$probe"; then
        echo "$probe"
        exit 0
    fi
done

echo "No main branch found" >&2
exit 2
